import React from "react";
import {
  Text,
  TouchableOpacity,
  StyleProp,
  ViewStyle,
  TextStyle,
} from "react-native";
import { Ionicons } from "@expo/vector-icons";

interface AddFriendButtonProps {
  onPress?: () => void;
  isCurrentUser: boolean;
  style: StyleProp<ViewStyle>;
  textStyle: StyleProp<TextStyle>;
  iconColor: string;
}

const AddFriendButton: React.FC<AddFriendButtonProps> = ({
  onPress,
  isCurrentUser,
  style,
  textStyle,
  iconColor,
}) => {
  if (isCurrentUser) {
    return null;
  }

  return (
    <TouchableOpacity style={style} onPress={onPress}>
      <Ionicons name="person-add-outline" size={20} color={iconColor} />
      <Text style={textStyle}>添加到通讯录</Text>
    </TouchableOpacity>
  );
};

export default AddFriendButton;
